<div class="m-subheader">
    <div class="align-items-center row" style="margin: 0;">
        <div class="float-left" style="min-width: 80px;">
            <h5 style="padding-top: 6px; padding-right: 20px;">
                <span>编码规则</span>
            </h5>
        </div>
        <!-- <div class="float-left" style="min-width: 240px;">
            <label>关键字</label>
            <input [(ngModel)]="filterText" style="width: 180px; display: inline-block; margin: 0 10px;" name="filterText"
                autoFocus class="form-control m-input" [placeholder]="l('SearchWithThreeDot')" type="text" />
        </div>

        <div class="float-left mr-auto" style="min-width: 80px;">
            <button (click)="getContracts($event)" class="btn btn-primary blue" type="submit">
                <i class="flaticon-search-1" [attr.aria-label]="l('Search')"> </i> 查询
            </button>
        </div> -->
        <div class="text-right">
            <button (click)="createGCodeItems()" class="btn btn-primary"><i class="fa fa-plus"></i> 新增根目录</button>
        </div>
        <div class="text-right">
            <button (click)="createCodeItems()" class="btn btn-primary"><i class="fa fa-plus"></i> 新增</button>
        </div>
        <!-- <div class="col-xs-6 text-right">
            <button (click)="updateCodeItems(codeitem)" class="btn btn-primary"><i class="fa fa-plus"></i> 修改</button>
        </div> -->
        <div class="text-right">
            <button (click)="deleteCodeItems(codeitem.id)" class="btn btn-primary"><i class="fa fa-plus"></i>
                删除</button>
        </div>
        <div class="text-right">
            <button
                class="btn btn-primary" type="button">
                <excel-import [showIcon]="false" [btnText]="'导入'" (onUpload)="onUpload($event)">
                </excel-import>
            </button>
        </div>
    </div>
</div>
<div class="m-content">
    <div class="row">
        <div class="col-lg-3">
            <codeitems-tree #ouCodeItemsTree (ouSelected)="ouSelected($event)" (ouallSelected)="ouallSelected($event)">
            </codeitems-tree>
        </div>
        <div class="col-lg-9">
            <form #roleForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="m-portlet m-portlet--mobile">



                    <div class="m-form m-form--label-align-right">
                        <div class="row">
                            <div class="col-8">
                                <div class="row align-items-center">

                                    <div class="col-4">
                                        <div class="form-group m-form__group row">
                                            <label class="col-8 col-form-label" for="f_IsUsing">是否启用编码</label>
                                            <div class="col-4">
                                                <input type="checkbox" #nameInput="ngModel" class="m-checkbox"
                                                    name="f_IsUsing" id="f_IsUsing" [(ngModel)]="codeitem.f_IsUsing"
                                                    style="margin-top: 10px;" />
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-6">
                                        <div class="form-group m-form__group row">
                                            <label class="col-4 col-form-label" for="f_CodeItemName">编码名称<span
                                                    style="color:red">*</span></label>
                                            <div class="col-8">
                                                <input type="text" class="form-control m-input" name="f_CodeItemName"
                                                    id="f_CodeItemName" #nameInput="ngModel"
                                                    [(ngModel)]="codeitem.f_CodeItemName" required maxlength="32"
                                                    style="margin-top: 5px;" />
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="row align-items-center">

                                    <div class="col-4">
                                        <div class="form-group m-form__group row">
                                            <label class="col-8 col-form-label" for="f_IsCodeItem">是否启用特征码</label>
                                            <div class="col-4">
                                                <input type="checkbox" #nameInput="ngModel" class="m-checkbox"
                                                    name="f_IsCodeItem" id="f_IsCodeItem"
                                                    [(ngModel)]="codeitem.f_IsCodeItem" style="margin-top: 10px;" />

                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-6">
                                        <div class="form-group m-form__group row">
                                            <label class="col-4 col-form-label" for="f_CodeItemId">特征码<span
                                                    style="color:red">*</span></label>
                                            <div class="col-8">
                                                <input type="text" class="form-control m-input" name="f_CodeItemId"
                                                    id="f_CodeItemId" #nameInput="ngModel"
                                                    [(ngModel)]="codeitem.f_CodeItemId" required maxlength="32"
                                                    style="margin-top: 5px;" />
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="row align-items-center">

                                    <div class="col-4">
                                        <div class="form-group m-form__group row">
                                            <label class="col-8 col-form-label" for="f_IsSeparator">是否启分隔符</label>
                                            <div class="col-4">
                                                <input type="checkbox" #nameInput="ngModel" class="m-checkbox"
                                                    name="f_IsSeparator" id="f_IsSeparator"
                                                    [(ngModel)]="codeitem.f_IsSeparator" style="margin-top: 10px;" />

                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-6">
                                        <div class="form-group m-form__group row">
                                            <label class="col-4 col-form-label" for="f_Separator">分隔符</label>
                                            <div class="col-8">
                                                <input type="text" class="form-control m-input" name="f_Separator"
                                                    id="f_Separator" #nameInput="ngModel"
                                                    [(ngModel)]="codeitem.f_Separator" maxlength="32"
                                                    style="margin-top: 5px;" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row align-items-center">

                                    <div class="col-4">
                                        <div class="form-group m-form__group row">
                                            <label class="col-8 col-form-label" for="f_IsTime">是否启用日期</label>
                                            <div class="col-4">
                                                <input type="checkbox" #nameInput="ngModel" class="m-checkbox"
                                                    name="f_IsTime" id="f_IsTime" [(ngModel)]="codeitem.f_IsTime"
                                                    style="margin-top: 10px;" />

                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-6">
                                        <div class="form-group m-form__group row">
                                            <label class="col-4 col-form-label" for="f_TimeCode">时间格式</label>
                                            <div class="col-8">
                                                <!-- <input
                                                    type="text"
                                                    class="form-control m-input"
                                                    name="f_CodeItemId"
                                                    id="f_CodeItemId"
                                                    #nameInput="ngModel"
                                                    [(ngModel)]="codeitem.f_CodeItemId"
                                                    required maxlength="32"
                                                    style="margin-top: 5px;" 
                                                /> -->



                                                <select #itemsCombobox name="f_TimeCode" class="form-control"
                                                    [(ngModel)]="codeitem.f_TimeCode" [attr.data-live-search]="true">
                                                    <option *ngFor="let deptitem of selectDate"
                                                        [value]="deptitem.value">{{deptitem.displayText}}</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>



                                <div class="row align-items-center">

                                    <div class="col-4">
                                        <div class="form-group m-form__group row">
                                            <label class="col-8 col-form-label" for="f_IsSequence">是否启用流水号</label>
                                            <div class="col-4">
                                                <input type="checkbox" #nameInput="ngModel" class="m-checkbox"
                                                    name="f_IsSequence" id="f_IsSequence"
                                                    [(ngModel)]="codeitem.f_IsSequence" style="margin-top: 10px;" />

                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-6">
                                        <div class="form-group m-form__group row">
                                            <label class="col-4 col-form-label" for="f_SequenceCode">流水号</label>
                                            <div class="col-8">
                                                <input type="text" class="form-control m-input" name="f_SequenceCode"
                                                    id="f_SequenceCode" #nameInput="ngModel"
                                                    [(ngModel)]="f_SequenceCode" maxlength="32" style="margin-top: 5px;"
                                                    (click)="codeRulesNumModal.show()" />
                                                <input id="f_SequenceCode1" name="f_SequenceCode1" class="form-control"
                                                    type="text" #nameInput="ngModel"
                                                    [(ngModel)]="codeitem.f_SequenceCode" style="display:none;" />
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="align-items-center">



                                    <div class="form-group m-form__group row">
                                        <label class="col-2 col-form-label" for="f_Remark">备注</label>
                                        <div class="col-8">
                                            <input type="text" class="form-control m-input" name="f_Remark"
                                                id="f_Remark" #nameInput="ngModel" [(ngModel)]="codeitem.f_Remark"
                                                maxlength="32" style="margin-top: 5px;" />
                                        </div>
                                    </div>

                                </div>


                            </div>

                        </div>
                    </div>






                    <!-- <div class="col-sm-9">
                         
                        
                         
                           
                       
                            <div class="form-group">
                                <label for="f_TimeCode">时间格式 </label>
                          
                         
                            </div>
                            <div class="form-group">
                                <label for="f_IsSequence">是否启用流水号</label>
                                <input id="f_IsSequence" #nameInput="ngModel" class="form-control" type="checkbox" name="f_IsSequence"
                                    [(ngModel)]="codeitem.f_IsSequence" maxlength="32" />
                            </div>
                            <div class="form-group">
                              
                                <label for="f_SequenceCode">流水号 </label>
                                <input  id="f_SequenceCode" name="f_SequenceCode" class="form-control" type="text" #nameInput="ngModel" [(ngModel)]="f_SequenceCode" (click)="codeRulesNumModal.show()"
                                   />
                                   <input  id="f_SequenceCode1" name="f_SequenceCode1" class="form-control"
                                    type="text" #nameInput="ngModel" [(ngModel)]="codeitem.f_SequenceCode" 
                                    style="display:none;"
                                 />
                               
                            </div>
                      
                        </div> -->
                    <div class="modal-footer">

                        <button type="submit" class="btn btn-primary" [disabled]="!roleForm.form.valid"
                            [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
                            <i class="fa fa-save"></i> <span>保存</span>
                        </button>
                    </div>

                </div>

            </form>
        </div>
    </div>
</div>
<codeRulesNumModal #codeRulesNumModal (modalSave)="rowSelect($event)">
</codeRulesNumModal>